import { create } from 'zustand';

interface WidgetState {
  hint: string;
  consoleStr: string | string[];
  leftPanel: string[];
  selectId: string;
  modalId: string;
  hisSelection: string[]; // 历史选择
  currentTools: string;
  setHint: (newHint: string) => void;
  setConsole: (newConsole: string | string[]) => void;
}

export const useWidgetStore = create<WidgetState>((set) => ({
  hint: '', // 默认值
  consoleStr: '', // 默认值
  leftPanel: [],
  selectId: '',
  modalId: '',
  hisSelection: [], // 历史选择
  currentTools: '',
  setHint: (newHint) => set({ hint: newHint }),
  setConsole: (newConsole) => set({ consoleStr: newConsole }),
}));
